﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace ZQNB.Common.Models
{
    public class SimpleMapper
    {
        public static TTo ToModel<TTo, TFrom>(TFrom entity)
        {
            string json = JsonConvert.SerializeObject(entity);
            TTo m = JsonConvert.DeserializeObject<TTo>(json);
            return m;
        }
    }
}
